package com.xiegang.apipassenger.controller;

import com.xiegang.apipassenger.Service.UserService;
import com.xiegang.internalcommon.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author xieGang
 * @description
 * @date 2023/3/9 19:32
 **/

@RestController
public class UserController {

    @Autowired
    private UserService userService;


    @GetMapping("/user")
    public ResponseResult getUserByPhone(HttpServletRequest request){
        String accessToken = request.getHeader("Authorization");
        return  userService.getUesrByPhone(accessToken);
    }

}
